using System;
using System.Collections.Generic;
using System.Text;

namespace Algorithms.Numerical.Impl
{
    public class MatrixImpl : Matrix
    {
        protected int height;
        protected int width;
        protected double[,] matrix;

        public MatrixImpl(int height, int width)
        {
            this.height = height;
            this.width = width;
            this.matrix = new double[this.height, this.width];
        }

        public MatrixImpl(double[,] m)
        {
            this.height = m.GetLength(0);
            this.width = m.GetLength(1);
            this.matrix = new double[this.height, this.width];
            this.Assign(m);
        }

        public override int Height
        {
            get
            {
                return this.height;
            }
        }

        public override int Width
        {
            get
            {
                return this.width;
            }
        }

        public override double this[int y, int x]
        {
            get
            {
                return this.matrix[y, x];
            }
            set
            {
                this.matrix[y, x] = value;
            }
        }
    }
}
